<template>
  <div class="inventory-execute">
    <el-form :model="formData" ref="form" :rules="rules" label-width="120px">
      <div class="form-section">
        <h3>盘点执行</h3>
        
        <el-table
          :data="formData.items"
          border
          style="width: 100%">
          <el-table-column prop="assetNo" label="资产编号" width="150"></el-table-column>
          <el-table-column prop="assetName" label="资产名称" width="180"></el-table-column>
          <el-table-column prop="location" label="存放位置"></el-table-column>
          <el-table-column prop="status" label="盘点状态" width="120">
            <template slot-scope="scope">
              <el-select v-model="scope.row.status">
                <el-option label="正常" value="normal"></el-option>
                <el-option label="异常" value="abnormal"></el-option>
                <el-option label="待确认" value="pending"></el-option>
              </el-select>
            </template>
          </el-table-column>
          <el-table-column prop="remark" label="备注">
            <template slot-scope="scope">
              <el-input v-model="scope.row.remark"></el-input>
            </template>
          </el-table-column>
        </el-table>
      </div>

      <div class="form-actions">
        <el-button @click="prevStep">上一步</el-button>
        <el-button type="primary" @click="submitForm">下一步</el-button>
      </div>
    </el-form>
  </div>
</template>

<script>
export default {
  name: 'InventoryExecute',
  data() {
    return {
      formData: {
        items: [
          { assetNo: 'ZC001', assetName: '台式电脑', location: '技术部', status: 'normal', remark: '' },
          { assetNo: 'ZC002', assetName: '打印机', location: '行政部', status: 'normal', remark: '' }
        ]
      },
      rules: {}
    }
  },
  methods: {
    prevStep() {
      this.$emit('prev-step')
    },
    submitForm() {
      this.$refs.form.validate(valid => {
        if (valid) {
          this.$emit('next-step', this.formData)
        }
      })
    }
  }
}
</script>

<style lang="scss" scoped>
.inventory-execute {
  .form-section {
    margin-bottom: 30px;
    
    h3 {
      margin: 0 0 20px;
      padding-left: 10px;
      border-left: 4px solid #409EFF;
      font-size: 18px;
      font-weight: 500;
      color: #303133;
    }
  }

  .form-actions {
    text-align: center;
    margin-top: 40px;
  }
}
</style> 